#!/bin/bash
#
#******************************************************************************
# version-fix (XPC)
#------------------------------------------------------------------------------
##
# \file       	build
# \library    	XPC
# \author     	Chris Ahlstrom
# \date       	2012-01-02
# \update     	2012-04-02
# \version    	$Revision$
# \license    	$XPC_SUITE_GPL_LICENSE$
#
#     The above is modified by the following to remove even the mild GPL
#     restrictions:
#
#     Use this script in any manner whatsoever.  You don't even need to give
#     me any credit.  However, keep in mind the value of the GPL in keeping
#     software and its descendant modifications available to the community
#     for all time.
#
#     This script will eventually go through the entire project, cleaning up
#     version information.
#
# \usage
#     See the --help text.
#
# \param $1
#     Provides the new version string, such as "1.1.2".
#
# \param $2
#     Provides the old version string, such as "1.1.0".
#
#------------------------------------------------------------------------------

#******************************************************************************
# Set up a useful, sane environment
#------------------------------------------------------------------------------

source scripts/boot_functions

#******************************************************************************
# Default option values
#------------------------------------------------------------------------------

DOCLEAN="no"
DOLOG="no"
LOGFILENAME=""
NEW_VERSION_ALL="1.1.0"
NEW_VERSION_MAIN="1.1"
NEW_VERSION_MAJOR="1"
NEW_VERSION_MINOR="1"
NEW_VERSION_PATCH="0"
NEW_VERSION_DATE=$XPC_SCRIPT_EDIT_DATE

#******************************************************************************
# Help
#------------------------------------------------------------------------------

if [ "$1" == "--help" ] ; then

   cat << E_O_F

XPC Library Suite Version Fixup

Usage: $0 [options] new_version old_version

   The following options can modify what is done.
   
 --project name      Select which project to build. [$PROJECT] The following are
 --log file          Write the main commands to the given file. [$DOLOG] This
                     is a good check of the progress of the build script.

E_O_F

if [ ! -d src ] ; then
   die 2 "startup" \
      "COULD NOT FIND THE 'src' DIRECTORY.  Please run './build'" \
      "from the root of the XPC directory hierarchy (xpc_suite-x.y)."
fi

if [ $# -ge 1 ] ; then

   while [ "$1" != "" ] ; do

      case "$1" in

         --project)
            shift
            PROJECT="$1"
            if [ "$PROJECT" == "" ] ; then
               die 4 "CLI" "Please specify a --project name."
            fi
            ;;

         --log)
            DOLOG="yes"
            ;;

         *)
            die 6 "CLI" \
               "Unsupported XPC build option; --help for more information" ;
            ;;
      esac

      shift

   done

fi

#******************************************************************************
# Do the work
#------------------------------------------------------------------------------

#******************************************************************************
# Almost every file
#------------------------------------------------------------------------------
# \version     $Revision$           --> \version    1.1.0
#---------------------------------------------------------------------------
# xpc_suite-1.1
#---------------------------------------------------------------------------
# \update      2012-01-01
#------------------------------------------------------------------------------

#******************************************************************************
# Scripts
#------------------------------------------------------------------------------
# XPC_LIBRARY_API_VERSION="1.1"
#---------------------------------------------------------------------------
# XPC_LIBRARY_VERSION="$XPC_LIBRARY_API_VERSION.0"
#------------------------------------------------------------------------------

#******************************************************************************
# configure.ac
#------------------------------------------------------------------------------
# AC_REVISION($Revision: 1.1.0$)dnl
#---------------------------------------------------------------------------
# AC_INIT(xpc, [1.1], ...
#---------------------------------------------------------------------------
# VERSION="1.1.0"
#---------------------------------------------------------------------------
# XPC_API_MAJOR="1"
#---------------------------------------------------------------------------
# XPC_API_MINOR="1"
#---------------------------------------------------------------------------
# XPC_API_PATCH="0"
#---------------------------------------------------------------------------
# #define VERSION "1.1.0"
#---------------------------------------------------------------------------
# #define API_VERSION "1.1"
#------------------------------------------------------------------------------

#******************************************************************************
# xpc.pot
#------------------------------------------------------------------------------
# "Project-Id-Version: xpc 1.1.0\n"
#------------------------------------------------------------------------------

#******************************************************************************
# Doxyfile/doxygen*.cfg
#------------------------------------------------------------------------------
# PROJECT_NUMBER         = 1.1.0
#------------------------------------------------------------------------------

#******************************************************************************
# Doxygen documents
#------------------------------------------------------------------------------
# \version    $Revision$ (1.1.0)
#------------------------------------------------------------------------------

#******************************************************************************
# Misc. documents
#------------------------------------------------------------------------------
# version 1.1.0
#------------------------------------------------------------------------------
# Version 1.1.0
#------------------------------------------------------------------------------
# xpccut_pre = 1.1.0
#------------------------------------------------------------------------------

#******************************************************************************
# Old source code
#------------------------------------------------------------------------------
# \updates       2010-03-06 to 2010-03-21
#------------------------------------------------------------------------------


#******************************************************************************
# version-fix (XPC)
#------------------------------------------------------------------------------
# Local Variables:
# End:
#------------------------------------------------------------------------------
# vim: ts=3 sw=3 et ft=sh
#------------------------------------------------------------------------------
